package com.huanong.mapper;
/*
 *@Author:anran
 *@Date:2020/12/8
 *@Version 1.0
 */


import com.huanong.pojo.Types;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 产品类型相关的类
 */
@Repository
public interface TypesMapper {

    @Select("select * from types")
    List<Types> query();

    @Select("select * from types where tsid=#{TsId}")
    Types queryById(@Param("TsId") Integer TsId);

    @Insert("insert into types (tsname) values(#{TsName})")
    int addTypes(Types types);

    @Delete("delete from types where tsid=#{TsId}")
    int deleteTypes(@Param("TsId") Integer TsId);

    @Update("update types set tsname=#{TsName} where tsid=#{TsId}")
    int updateTypes(Types types);
}
